﻿using System;

namespace CommonDevelop.Scene
{
    /// <summary>
    /// 系统菜单类---在架构中，确认有效操作的业务结构，保障操作的重用性
    /// </summary>
    [Serializable]
    public class SysMenu
    {
        public SysMenu()
        {
            this.Module_Id = Guid.NewGuid().ToString("N");
            this.AddTime = DateTime.Now;
        }
        public SysMenu(string MenuId)
        {
            this.Module_Id = MenuId;
            this.AddTime = DateTime.Now;
        }

        public string Module_Id { get; set; }
        public string Parent_Id { get; set; }
        public string Module_Code { get; set; }
        public string Module_Name { get; set; }
        public string Module_Icon { get; set; }
        public string Module_Action { get; set; }
        public string Module_Address { get; set; }
        public DateTime AddTime { get; set; }

        public string AddTimeView
        {
            get
            {
                return this.AddTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            set
            {
                DateTime dt;
                if (DateTime.TryParse(value, out dt))
                    this.AddTime = dt;
            }
        }
    }
}
